/*
 * Cod_Audio.h
 *
 *  Created on: 02/06/2011
 *      Author: mariano
 */
#ifndef COD_AUDIO_H_
#define COD_AUDIO_H_

#ifdef __cplusplus
#define __STDC_CONSTANT_MACROS
#ifdef _STDINT_H
#undef _STDINT_H
#endif
# include <stdint.h>
#endif
extern "C" {
	#include <libavformat/avformat.h>
	#include <libswscale/swscale.h>
}
#include <fstream>

class Cod_Audio {
private:
    AVCodec *codec;
    int out_size, outbuf_size;
    //uint8_t outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
    AVCodecContext *encoder_Ctx;
public:
	Cod_Audio();
	virtual ~Cod_Audio();
	void register_codecs();
	int busca_encoder();
	int abre_encoder();
	int codificar(short *samples, int outbuf_size, uint8_t **outbuf);
	int getFrameSize();
	void ini_contexto();
};

#endif /* COD_AUDIO_H_ */
